package com.lucian.ge.comman.model;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * Created by Lucicol on 2019/7/19.
 */
@Component
public class ResultMapSyn extends HashMap<String, Object> {
    public ResultMapSyn() {
    }

    public ResultMapSyn success() {
        this.put("result", "success");
        return this;
    }

    public ResultMapSyn fail() {
        this.put("result", "fail");
        return this;
    }

    public ResultMapSyn code(int code) {
        this.put("code", code);
        return this;
    }

    public ResultMapSyn message(Object message) {
        this.put("message", message);
        return this;
    }

    public ResultMapSyn data(JSON data) {
        this.put("data", data);
        return this;
    }

    public ResultMapSyn token(Object data) {
        this.put("token", data);
        return this;
    }

    public ResultMapSyn res(Object data) {
        this.put("res", data);
        return this;
    }
}
